#include "StdAfx.h"
#include "MsgQueue.h"

CMsgQueue::CMsgQueue(void)
{
}

CMsgQueue::~CMsgQueue(void)
{
}

bool CMsgQueue::Init()
{
	::InitializeCriticalSection(&m_Section);
	return true;
}

void CMsgQueue::PushMessage(CBaseMessage* pMsg)
{
	EnterCriticalSection(&m_Section);
	m_queMessage.push_back(pMsg);
	LeaveCriticalSection(&m_Section);
}

deque<CBaseMessage*>& CMsgQueue::GetAllMessage()
{
	return m_queMessage;
}